//------------------------------------------------------------------------------
//  ResourceSaver.cpp
//  (C) 2010 xoyojank
//------------------------------------------------------------------------------
#include "StdEddy.h"
#include "Graphics/ResourceSaver.h"
#include "Graphics/Resource.h"

//------------------------------------------------------------------------------
namespace Eddy
{

//------------------------------------------------------------------------------
ResourceSaver::ResourceSaver()
{
    // empty
}

//------------------------------------------------------------------------------
ResourceSaver::~ResourceSaver()
{
    // empty
}

//------------------------------------------------------------------------------
bool
ResourceSaver::OnSave()
{
    assert(this->resource.isvalid());
    assert(this->resource->IsLoaded());

    // override by subclass

    this->resource = NULL;
    return true;
}

//------------------------------------------------------------------------------
void
ResourceSaver::OnAttachResource(const ResourcePtr& res)
{
    assert(res.isvalid());
    assert(!this->resource.isvalid());

    this->resource = res;
}

}// Eddy
